using UnityEngine;
using System.Collections;

public class MissileUpgradeChecker : MonoBehaviour {

	public GameObject missilePrefab;
	GameManager gm;

	void Start() {
		gm = GameObject.FindObjectOfType<GameManager>();
		DoCheck();
	}

	void Update () {
		DoCheck();
	}

	void DoCheck() {
		if(gm.turretsFireMissiles) {
			GetComponent<ShootsBullets>().bulletPrefab = missilePrefab;
			Destroy (this);
		}
	}
}
